﻿using UnityEngine;
namespace Core
{
    public class CollideComponent : Entity, IAwake
    {
        private Collider[] colliders;
        void IAwake.Awake()
        {
            colliders = GetParent<Unit>().transform.GetComponentsInChildren<Collider>();
        }

        public void SetEnable(bool enable)
        {
            foreach (var collider in colliders)
            {
                collider.enabled = enable;
            }
        }

    }

}